<template>
    <div class="orh-sub-table">
        <div class="content" :class="{ispad:noPadding}">
            <div class="menu" v-if="$slots.meuntab">
                <slot name="meuntab"></slot>
            </div>
            <div class="table">
                <slot name="table"></slot>
            </div>
        </div>
        <div class="footer" v-if="pages">
            <p class="count">共有 {{pageDate.total}} 条记录</p>
            <Page :total="pageDate.total" :page-size="pageDate.per_page" :current.sync="pageDate.current_page" class="page" @on-change="pageChange"></Page>
        </div>
    </div>
</template>

<script>

    export default {
        data() {
            return {
                
            }
        },
        props: {
            'pages': Boolean,
            'noPadding': Boolean,
            'pageDate': Object
        },
        methods: {
            pageChange(page) {
                this.$emit('on-page-change',page);
            }
        },
        created() {
            // console.log(this.$slots)
        }
    }
</script>

<style lang="less">
.orh-sub-table {
    width: 100%;
    height: 100%;
    // position: relative;
    .content {
        padding: 15px; 
        position: absolute;
        bottom: 55px; top: 0px;
        right: 0; left: 0;
        overflow: auto;
        display: flex;
        background: #fff;
        .menu {
            width: 200px;
            margin-right: 15px;
            height: 100%;
            overflow: auto;
        }
        .table {
            flex: 1;
            height: 100%;
            overflow: auto;
        }
    }
    .footer {
        width: 100%;
        height: 55px;
        line-height: 55px;
        position: absolute;
        bottom: 0px;
        border-top: 1px solid #e9eaec;
        .count {
            float: left;
            padding-left: 25px;
        }
        .page {
            float: right;
            margin-right: 25px;
        }
    }
    &.ispad {
        padding: 0px; 
    }
}
</style>
